package com.gpStudy.design.single;

/**
 * 懒汉式，同步块
 *
 */
public class LazySingleton_DoubleCheck_volatile {

    private LazySingleton_DoubleCheck_volatile() {
    }

    private static volatile LazySingleton_DoubleCheck_volatile lazySingleton;

    public static synchronized LazySingleton_DoubleCheck_volatile getInstance(){
        if(null == lazySingleton){
            synchronized(LazySingleton_DoubleCheck_volatile.class){
                lazySingleton = new LazySingleton_DoubleCheck_volatile();
            }
        }
        return lazySingleton;
    }
}
